import Vue from 'vue'
import VueRouter from 'vue-router'
import IndexView from "@/views/IndexView.vue";
import CommentsView from "@/views/CommentsView.vue";
import UserView from "@/views/UserView.vue";
import RequestQuotation from '@/views/RequestQuotation'
import ExplosiveProduct from '@/views/ExplosiveProduct'
import SubscribeManage from '@/views/SubscribeManage'
import SendEmail from '@/views/SendEmail'
import RoleView from "@/views/RoleView.vue";
import MenuView from "@/views/MenuView.vue";
import HomeView from "@/views/HomeView.vue";


Vue.use(VueRouter)

const routes = [
  {

    path: '/',
    name: 'index',
    redirect:"home",
    component: IndexView,
    meta: {
      requireAuth: true

    },
    children:[
      {
        path: '/home',
        name: 'home',
        component: HomeView,
        meta: {
          requireAuth: true

        }
      },
        {
      path: '/comments',
          name: 'comments',
          component: CommentsView,
      meta: {
        requireAuth: true

      }
    },
      {
        path: '/user',
        name: 'user',
        component: UserView,
        meta: {
          requireAuth: true
        }
      },
      {
        path: '/role',
        name: 'role',
        component: RoleView,
        meta: {
          requireAuth: true
        }
      },
      {
        path: '/menu',
        name: 'menu',
        component: MenuView,
        meta: {
          requireAuth: true
        }
      },
      {
        path: '/request',
        component: RequestQuotation,
        meta:{
          requireAuth: true
        }
      },
      {
        path:'/explosive',
        component: ExplosiveProduct,
        meta:{
          requireAuth: true
        }
      },
      {
        path:'/subscribe',
        component: SubscribeManage,
        meta:{
          requireAuth: true
        }
      },
      {
        path:'/email',
        name: "email",
        component: SendEmail,
        meta:{
          requireAuth: true
        }
      }
    ]
  // [{
  //     path: '//comments',
  //     name: 'comments',
  //     component: CommentsView
  // }]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import(/* webpackChunkName: "about" */ '../views/LoginView.vue')
  },
  {
    path: '/hello',
    name: 'hello',
    component: () => import(/* webpackChunkName: "about" */ '../views/Hello.vue')
  }




]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
